﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="article.aspx.cs" Inherits="weikebuluo.web.wechat.api.article" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection" content="telephone=no" />
    <link href="../all/css/wechat.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="/Scripts/JQuery.min.js"></script>
    <script type="text/javascript" src="/Scripts/Su.common.js"></script>
    <script type="text/javascript" src="/Scripts/ActionRecord.js"></script>
    <title>
        <%=Article_Title %></title>
    <style type="text/css">
        #nickname
        {
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
            max-width: 90%;
        }
        ol, ul
        {
            list-style-position: inside;
        }
    </style>
    <style type="text/css">
        #activity-detail .page-content .text
        {
            font-size: 16px;
        }
    </style>
    <style type="text/css">
        .masklayer
        {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            z-index: 2000;
            width: 100%;
            height: 100%;
            background-color: rgba(0,0,0,0.5);
            text-align: right;
        }
        .masklayer.on
        {
            display: none;
        }
        .masklayer img
        {
            margin-top: 10px;
            margin-right: 30px;
            width: 180px;
        }
    </style>
</head>
<body>
    <div id="activity-detail" class="body">
        <div class="page-bizinfo">
            <div class="header">
                <h1 id="activity-name">
                    <%=Article_Title %></h1>
                <p class="activity-info">
                    <span id="post-date" class="activity-meta no-extra">
                        <%=Article_CreateTime %></span> <span class="activity-meta">点击右边关注→</span> <a href="javascript:;"
                            id="post-user" onclick=" $('.masklayer').show();" class="activity-meta"><span class="text-ellipsis">
                                <%=WeChat_Name %></span> <i class="icon_link_arrow"></i></a>
                </p>
            </div>
        </div>
        <div class="page-content">
            <div class="text">
                <%=Article_MainContent %>
            </div>
        </div>
    </div>
    <div id="mcover" onclick="document.getElementById('mcover').style.display='';" style="display: none;">
        <img alt="" src="/images/website/guide.png" />
    </div>
    <div style="padding-bottom: 0!important;">
        <a href="javascript:window.scrollTo(0,0);" style="font-size: 12px; margin: 5px auto;
            display: block; color: #fff; text-align: center; line-height: 35px; background: #333;
            margin-bottom: -10px;">返回顶部</a>
    </div>
    <div class="masklayer on" ontouchmove="return true;" onclick="$('.masklayer').hide();">
        <img src="/Content/Images/WeChat/instruction.png" />
    </div>
</body>
</html>
<script type="text/javascript">
    $(function () {
        $("#post-user").click(function () {
            $('.masklayer').show();
        })

        var onBridgeReady = function () {
            var appId = '';
            var imgUrl = '<%=Article_PicUrl %>';
            var link = window.location.href;
            var title = '<%=Article_Title %>';
            var desc = '<%=Article_Description %>';
            desc = desc || link;

            //发送给好友; 
            WeixinJSBridge.on('menu:share:appmessage', function (argv) {
                WeixinJSBridge.invoke('sendAppMessage', {
                    "appid": appId,
                    "img_url": imgUrl,
                    "img_width": "640",
                    "img_height": "640",
                    "link": link,
                    "desc": desc,
                    "title": title
                }, function (res) { });
            });
            //分享到朋友圈;
            WeixinJSBridge.on('menu:share:timeline', function (argv) {
                WeixinJSBridge.invoke('shareTimeline', {
                    "img_url": imgUrl,
                    "img_width": "640",
                    "img_height": "640",
                    "link": link,
                    "desc": desc,
                    "title": title
                }, function (res) { });
            });
            // 分享到微博;
            var weiboContent = '';
            WeixinJSBridge.on('menu:share:weibo', function (argv) {
                WeixinJSBridge.invoke('shareWeibo', {
                    "content": title + link,
                    "url": link
                }, function (res) { });
            });
            // 分享到Facebook
            WeixinJSBridge.on('menu:share:facebook', function (argv) {
                WeixinJSBridge.invoke('shareFB', {
                    "img_url": imgUrl,
                    "img_width": "640",
                    "img_height": "640",
                    "link": link,
                    "desc": desc,
                    "title": title
                }, function (res) { });
            });
        }

        if (document.addEventListener) {
            document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
        } else if (document.attachEvent) {
            document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
            document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
        }
    });
</script>
